package com.wang.domain;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * InitializingBean在Bean初始化的时候执行
 * DisposableBean在Bean销毁的时候执行
 */
public class InitDestory1 implements InitializingBean, DisposableBean {
    public InitDestory1() {
        System.out.println("InitDestory1构造函数");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("InitDestory1被初始化了");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("InitDestory1被销毁了");
    }
}
